package bishi.tongxingzhe;

public class Main {
    public static void main(String[] args) {
        char[] demo = new char[]{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'};
        System.out.print("交换前：");
        for(char x:demo) {
            System.out.print(x+" ");
        }
        System.out.println();
        for(int i = 0;i < demo.length - 1;i = i + 2) {
            char tem = demo[i];
            demo[i] = demo[i + 1];
            demo[i + 1] = tem;
        }
        System.out.print("交换后：");
        for(char x:demo) {
            System.out.print(x+" ");
        }
    }
}
